"""
Stephen Herbein, Ronald Lewis, Kyle Tucker, CISC220080, Dr. Atlas

Script that calls all other components of the program
"""

from subprocess import call
from httplib import *
import urllib2
import time
import os

# Call python program to get mapquest data
call("mapquestData.exe")

# Ensure the program has sufficient time to write its output
time.sleep(1)

# Call java program to analyze traffic data
call("java -jar AnalyzeImage.jar")

# Ensure the program has sufficient time to write its output
time.sleep(1)

# Call C++ program to perform algorithmic computation
call("Algorithm.exe")

# Ensure the program has sufficient time to read in the files before they are removed
time.sleep(1)

# Remove the generated files
os.remove("trafficData.txt")
os.remove("flow.gif")
os.remove("incidentData.txt")
